package bairui.international.model.type;

/**
 *
 * (电子券类型)Type_ElectronicTicket
 */
@com.lianjing.sh.processing.info.annotation.GenerateInfoModel
@com.lianjing.sh.model.common.annotation.Comment("电子券类型")
@com.lianjing.sh.processing.info.annotation.InfoComment("电子券类型")
public enum Type_ElectronicTicket implements com.sh_lianjing.standard.EnumCommentable<Type_ElectronicTicket> {

	/**
	 * (订单抵用券)OrderOffset</br>
	 */
	@com.lianjing.sh.model.common.annotation.Comment("订单抵用券")
	@com.lianjing.sh.processing.info.annotation.InfoComment("订单抵用券")
	OrderOffset("订单抵用券")
;

	private static java.util.Map<String, Type_ElectronicTicket> Cache = new java.util.HashMap<>();
	static{
		for(Type_ElectronicTicket enumItem : Type_ElectronicTicket.values()){
			Cache.put(enumItem.getComment(), enumItem);
		}
	}

	private String comment;

	private Type_ElectronicTicket(String comment){
		this.comment = comment;
	}

	@Override
	public String toString() {
		return comment;
	}

	@Override
	public String getComment() {
		return comment;
	}

	@Override
	public Type_ElectronicTicket parseByComment(String comment) {
		return Type_ElectronicTicket.parse(comment);
	}

	public static Type_ElectronicTicket parse(String comment) {
		Type_ElectronicTicket enumItem = Cache.get(comment);
		if(null == enumItem){
			 throw new com.sh_lianjing.standard.exception.EnumCommentableException(Type_ElectronicTicket.class, comment);
		}
		return enumItem;
	}

}
